home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
printing
/
iprint
/
fontdemo.ba_
/
fontdemo.ba
Wrap
Text File
|
1994-08-03
|
2KB
|
52 lines
Option Explicit
Sub GetFonts ()
'If the fonts were not loaded previously, load them now.
If FontDemoForm.FontList.ListCount = 0 Then
'Load the fonts
Call LoadFonts
'Add available sizes to the SizeList box
FontDemoForm.SizeList.AddItem "8"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 8
FontDemoForm.SizeList.AddItem "9"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 9
FontDemoForm.SizeList.AddItem "10"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 10
FontDemoForm.SizeList.AddItem "12"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 12
FontDemoForm.SizeList.AddItem "14"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 14
FontDemoForm.SizeList.AddItem "18"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 18
FontDemoForm.SizeList.AddItem "24"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 24
FontDemoForm.SizeList.AddItem "36"
FontDemoForm.SizeList.ItemData(FontDemoForm.SizeList.NewIndex) = 36
End If
End Sub
Sub LoadFonts ()
Dim i As Integer
Dim ScreenFontCount As Integer
'Set ScreenFontCount to the total number of screen
'fonts available on the user's system.
ScreenFontCount = Screen.FontCount
'Add the available fonts to the FontList box
For i = 0 To (ScreenFontCount - 1)
'Allow the message box to flash
DoEvents
FontDemoForm.FontList.AddItem Screen.Fonts(i)
Next i
End Sub
Sub UpdateLabel ()
'Update the font sample label when the user selects a new attribute.
FontDemoForm.SampleLabel.FontName = FontDemoForm.FontList.Text
FontDemoForm.SampleLabel.FontSize = Val(FontDemoForm.SizeList.Text)
FontDemoForm.SampleLabel.FontUnderline = FontDemoForm.UnderlineOption.Value
FontDemoForm.SampleLabel.FontItalic = FontDemoForm.ItalicsOption.Value
FontDemoForm.SampleLabel.FontBold = FontDemoForm.BoldOption.Value
FontDemoForm.SampleLabel.Caption = "This is a Sample of the " + FontDemoForm.FontList.Text + " font in size " + FontDemoForm.SizeList.Text
End Sub